<?php
/**
 * 総評コンポーネントモジュール
 */
require_once __DIR__ . '/../Components.php';
require_once __DIR__ . '/GeneralCommentMapper.php';
require_once '/Smarty/Components/textarea.php';
require_once 'Session.php';

/**
 * 総評コンポーネントクラス
 */
class Components_GeneralComment extends Smarty_Components_TextArea
{
	/** データマッピングオブジェクト */
	protected $_objMapper;
	/** セッションオブジェクト */
	protected $_objSession;

	/**
	 * コンストラクタ
	 * @param unknown_type $sCompileId
	 */
	public function __construct($sCompileId)
	{
		global $SESSION;

		$this->_objMapper = new Components_GeneralComment_Mapper();

		$sCompileDir = Components::getCompileDir();
		$Name = Models_HttpRequest_Controller::GENERAL_COMMENT_TEXT;
		$Width = 100;
		$Height = 100;
		$DefaultText = $this->_objMapper->getComment();
		parent::__construct($sCompileDir, $sCompileId, $Name, $Width, $Height, $DefaultText);

		$SESSION->setValue(Models_HttpRequest_Controller::GENERAL_COMMENT_WRITER, $this->_objMapper->getWriter());
	}
}